package com.wzh.design.strategy.demo3;

import jdk.nashorn.internal.runtime.linker.LinkerCallSite;

/**
 * @description: 策略模式
 * @author: WZH
 * @time: 2021/5/26 9:44
 */
public class Demo {


    public static void main(String[] args) {
        ZhangSan zhangSan = new ZhangSan();
        zhangSan.name = "张三";
        Lisi lisi = new Lisi();
        lisi.name = "李四";
        Athlete athlete = new Athlete();
        Singer singer = new Singer();

        System.out.println("我叫"+zhangSan.name);
        zhangSan.setSpecificSkill(athlete);
        zhangSan.setSpecificBehavior(() -> System.out.println("扣脚"));
        zhangSan.hobby();
        zhangSan.commonSkill1();
        zhangSan.commonSkill2();
        zhangSan.uniqeBehavior();
        zhangSan.uniqueSkill();

        System.out.println("");
        System.out.println("");
        System.out.println("");
        System.out.println("");


        System.out.println("我叫"+lisi.name);
        lisi.setSpecificSkill(singer);
        lisi.hobby();
        lisi.commonSkill1();
        lisi.commonSkill2();
        lisi.uniqeBehavior();
        lisi.uniqueSkill();





    }
}
